package com.wd.live.wxapi

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import com.tencent.mm.opensdk.modelbase.BaseReq
import com.tencent.mm.opensdk.modelbase.BaseResp
import com.tencent.mm.opensdk.openapi.IWXAPI
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler
import com.tencent.mm.opensdk.openapi.WXAPIFactory
import com.wd.live.view.Activity.MainActivity

class WXEntryActivity : Activity(), IWXAPIEventHandler {
    private val APP_ID = "wx064904aa8809f5aa"

    // IWXAPI 是第三方app和微信通信的openApi接口
    private lateinit var api: IWXAPI


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // 通过WXAPIFactory工厂，获取IWXAPI的实例
        api = WXAPIFactory.createWXAPI(this, APP_ID, true)

        api.handleIntent(getIntent(), this);

    }


    override fun onReq(p0: BaseReq?) {

    }

    override fun onResp(p0: BaseResp) {

            startActivity(Intent(this,MainActivity::class.java))
            finish()


    }

}

